
<html><HEAD>
<LINK REL=STYLESHEET HREF="default.css" TYPE="text/css">
<TITLE>
Creating a project</TITLE>
</HEAD>
<BODY>

<!-- Header -->
<p class="ancestor" align="right"><A HREF="pbugp273.htm">Previous</A>&nbsp;&nbsp;<A HREF="pbugp275.htm" >Next</A>
<!-- End Header -->
<A NAME="CHDBGAGJ"></A><h1>Creating a project</h1>
<A NAME="TI10125"></A><p>You can create a new project when you create a new target
using most Target wizards. You can also create a project at any
time from the Project page in the New dialog box if you have already
created a target of the appropriate type. For example, to create
a new .NET Web Forms application project, you must have a .NET Web
Forms target.</p>
<A NAME="TI10126"></A><p>The Project page has two kinds of icons: icons that open wizards
that help you set up a project, and icons that open the Project
painter. Wizard icons display next to the icon for the same project
type. The following procedure describes how to create a new project
from the Project page. </p>
<A NAME="TI10127"></A><p><img src="images/proc.gif" width=17 height=17 border=0 align="bottom" alt="Steps"> To create a new project object from the Project
page:</p>
<ol><li class=fi><p>Select File&gt;New or click the New
button in the PowerBar to open the New dialog box.</p></li>
<li class=ds><p>Select the Project tab.</p></li>
<li class=ds><p>Select the target in which you want to create
the project from the Target drop-down list.</p></li>
<li class=ds><p>Select the wizard or project type you need and
click OK.</p><p>If you select a wizard, complete the wizard screens to create
a new project with most of its properties specified. Use the context-sensitive
Help if you are not sure what to enter. You can open the Project
painter now or later to modify the properties if necessary and to
build the project. </p><p>If you do not select a wizard, the Project painter for the
type of object you selected opens so that you can specify properties
of the project object.</p><p>Once you have created a project, you can open it from the
System Tree. </p><p><img src="images/note.gif" width=17 height=17 border=0 align="bottom" alt="Note"> <span class=shaded>Projects can be modified only in the painter</span> <A NAME="TI10128"></A>Unlike most other PowerBuilder objects, a project object cannot
be edited in the Source editor.</p>
</li></ol>
<br><A NAME="TI10129"></A><h4>Target-relative paths and shared projects</h4>
<A NAME="TI10130"></A><p>All paths used in projects are stored as target-relative paths,
if possible. If you later move the application to a different location
in the file system, or another user copies or checks out the application,
the paths are adjusted relative to the new target location. </p>
<A NAME="TI10131"></A><p>For example, suppose user A has an application target stored
in the following directory structure, where <i>pbl_1.pbl</i> contains
the application object:<p><PRE> C:\target1\target1.pbt<br>C:\target1\pbls\pbl_1.pbl<br>C:\target1\pbls\pbl_2.pbl<br>C:\target1\res\target1.pbr<br>C:\target1\out\target1.exe</PRE></p>
<A NAME="TI10132"></A><p>When user B copies the application to the following directory
structure, no changes need to be made in the Project painter, because
the paths reflect the new directory structure:<p><PRE> D:\PB\My Targets\Target 1\target1.pbt<br>D:\PB\My Targets\Target 1\pbls\pbl_1.pbl<br>D:\PB\My Targets\Target 1\pbls\pbl_2.pbl<br>D:\PB\My Targets\Target 1\res\target1.pbr<br>D:\PB\My Targets\Target 1\out\target1.exe</PRE></p>
<A NAME="TI10133"></A><p>A projects that was created in an earlier version of PowerBuilder
using hard-coded paths must be opened and resaved before
the files it references are modified with target-relative paths.</p>
<A NAME="TI10134"></A><p>If a path is not on the drive where the target is stored,
then the path is stored as an absolute path. For example, the path
to image files stored on a shared network directory such as <i>J:\res\images\common</i> is
stored as an absolute path in the project file.</p>
<p><img src="images/note.gif" width=17 height=17 border=0 align="bottom" alt="Note"> <span class=shaded>References to files outside the target path</span> <A NAME="TI10135"></A>If a project references a PBL or another file on a local drive
that is outside the path of the target, make sure that the PBL or
file is copied to the new target location and that it is referenced
correctly in the project.</p>

